GO
/****** Object:  Table [dbo].[TrustDistrict]    Script Date: 11/29/2011 09:45:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TrustDistrict](
	[TrustDistrictID] [int] NOT NULL,
	[Name] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[Description] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[TrustRegionID] [int] NOT NULL,
	[Status] [bit] NOT NULL,
 CONSTRAINT [PK_TrustDistrict] PRIMARY KEY CLUSTERED 
(
	[TrustDistrictID] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF

GO
/****** Object:  Table [dbo].[TrustRegion]    Script Date: 11/29/2011 09:46:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TrustRegion](
	[TrustRegionID] [int] NOT NULL,
	[TrustRegionName] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[Description] [nchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[CountryID] [int] NOT NULL,
	[Status] [bit] NOT NULL,
 CONSTRAINT [PK_TrustRegion] PRIMARY KEY CLUSTERED 
(
	[TrustRegionID] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF

GO
/****** Object:  Table [dbo].[GovOfficeRegion]    Script Date: 11/29/2011 09:46:50 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[GovOfficeRegion](
	[GovOfficeRegionID] [int] NOT NULL,
	[GovOfficeRegionName] [nchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[CountyID] [int] NOT NULL,
	[CountryID] [int] NOT NULL,
 CONSTRAINT [PK_GovOfficeRegion] PRIMARY KEY CLUSTERED 
(
	[GovOfficeRegionID] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[County]    Script Date: 11/29/2011 09:47:03 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[County](
	[CountyID] [int] NOT NULL,
	[CountryID] [int] NOT NULL,
	[CountyName] [nchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
 CONSTRAINT [PK_County] PRIMARY KEY CLUSTERED 
(
	[CountyID] ASC,
	[CountryID] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
ALTER TABLE [dbo].[County]  WITH CHECK ADD  CONSTRAINT [FK_County_County] FOREIGN KEY([CountyID], [CountryID])
REFERENCES [dbo].[County] ([CountyID], [CountryID])
GO
ALTER TABLE [dbo].[County] CHECK CONSTRAINT [FK_County_Count

GO
/****** Object:  Table [dbo].[Country]    Script Date: 11/29/2011 09:47:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Country](
	[CountryID] [int] NOT NULL,
	[CountryName] [nchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
 CONSTRAINT [PK_Country] PRIMARY KEY CLUSTERED 
(
	[CountryID] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[ReferenceData]    Script Date: 11/29/2011 09:47:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReferenceData](
	[RefID] [int] NOT NULL,
	[RefCode] [int] NOT NULL,
	[RefValue] [nchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
 CONSTRAINT [PK_ReferenceData] PRIMARY KEY CLUSTERED 
(
	[RefID] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[POSTZON]    Script Date: 11/29/2011 09:47:45 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[PostZon](
	[POSTZON_ID] [int] NOT NULL,
	[Ward] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[Borought] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[LocalAuthority] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[UnitaryAuthority] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[NHSAuthority] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[GovOfficeRegionID] [int] NOT NULL,
	[TrustRegionID] [int] NOT NULL,
	[TrustDistrictID] [int] NOT NULL,
 CONSTRAINT [PK_POSTZON] PRIMARY KEY CLUSTERED 
(
	[POSTZON_ID] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF